Source File
utils.go
Belonging Package
github.com/AlexanderGrooff/mermaid-ascii/pkg/diagram
package diagramimport ()// removeComments removes Mermaid comment lines from input.// This function is shared between graph and sequence diagram parsers.// It handles both full-line comments (%% at start) and inline comments (%% after content).func ( []string) []string {:= make([]string, 0, len())for , := range {// Skip lines that start with %% (full-line comments)if strings.HasPrefix(strings.TrimSpace(), "%%") {continue}// Remove inline comments (anything after %%)if := strings.Index(, "%%"); != -1 {= strings.TrimSpace([:])}// Only keep non-empty lines after comment removalif len(strings.TrimSpace()) > 0 {= append(, )}}return}// SplitLines splits input on both actual newlines and escaped newlines (for curl compatibility).func ( string) []string {:= regexp.MustCompile(`\n|\\n`)return .Split(, -1)}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |